Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit hooks update; mypy, ruff fixes #3142

Merged
merged 10 commits into from
Aug 13, 2024
Merged

Conversation

martinhoyer
Copy link
Collaborator

New mypy version was throwing error. I've done my best to address them, but definitely needs @happz's eyes.

Refurb rules are now out of 'preview' and surprisingly, tmt passes almost everything with flying colors 🚀.
Only thing it didn't like regex flag aliases and readlines(), which was used only in one place.

Not updating to latest version of pyright. There are errors linked to UnserializeCallback, which I couldn't properly figure out.

T = TypeVar('T')
UnserializeCallback = Callable[[Any], T]

FWIW - from https:/microsoft/pyright/releases 1.1.372:

Fixed bug that results in some circumstances in incorrect specialization of type[T] when T evaluates to Any.
Fixed false positive error when using an overloaded init_subclass method under certain circumstances.

@martinhoyer martinhoyer added command | lint tmt lint command code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. labels Aug 9, 2024
@martinhoyer martinhoyer self-assigned this Aug 9, 2024
@martinhoyer martinhoyer added the ci | full test Pull request is ready for the full test execution label Aug 9, 2024
tmt/utils/__init__.py Outdated Show resolved Hide resolved
@happz happz added the code | style Code style changes not affecting functionality label Aug 12, 2024
@happz happz added this to the 1.36 milestone Aug 12, 2024
@seberm seberm self-requested a review August 13, 2024 11:46
@seberm
Copy link
Collaborator

seberm commented Aug 13, 2024

Please remember to rebase your changes on top of the main just before merging to make sure all the code passes the checks.

Copy link
Collaborator

@thrix thrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with some small comments)

@happz
Copy link
Collaborator

happz commented Aug 13, 2024

Please remember to rebase your changes on top of the main just before merging to make sure all the code passes the checks.

No worries, he who merges is always limited to fast-forward only, therefore rebase to main is a must.

@happz happz added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Aug 13, 2024
Removing explicit container_field overloads for ConainerClass and
ContainerInstance to have an unified return output.
According to mypy, it would never got to the second instance of
overloaded container_field, as the first one is same or broader.
Replacing regex flag aliases with full name to pass FURB167.
Removing one .readlines() usage for efficiency (FURB129).
Flynt f-strings checks passes, ignoring tests/unit dir.
@happz
Copy link
Collaborator

happz commented Aug 13, 2024

Unrelated failure, merging.

@happz happz merged commit 0520731 into teemtee:main Aug 13, 2024
19 of 20 checks passed
The-Mule pushed a commit to The-Mule/tmt that referenced this pull request Oct 14, 2024
Update pre-commit hooks, update Ruff, enable flynt and refurb ruff rules and address newly found errors

Removing explicit container_field overloads for ConainerClass and
ContainerInstance to have a unified return output.
According to mypy, it would never got to the second instance of
overloaded container_field, as the first one is the same or broader.

Replacing regex flag aliases with full name to pass FURB167.
Removing one .readlines() usage for efficiency (FURB129).
Flynt f-strings check passes, ignoring tests/unit dir.

Co-authored-by: Miloš Prchlík <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci | full test Pull request is ready for the full test execution code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. code | style Code style changes not affecting functionality command | lint tmt lint command status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants